#pragma once
#include <util.ice>

module Xts
{
	module Tom
	{
		//Asset class
	   enum XAssetClass{
		   UnkownAsset, 		//未知资产类型
		   Stock, 				//股票
		   Bond,  				//债券
		   Option,  			//期权
		   Future,  			//期货
		   //FuturesOption,		//期货期权
		   Forex, 				//外汇		   
		   Index, 				//指数
		   InterestRate, 		//利率
		   ETF, 				//交易型开放式指数基金
		   LOF, 				//上市型开放式基金
		   Spot 				//现货		      
	   };
	   
	   //Contract Type
	   enum XContractType{
			NoContract,				//未知合约类型
			Call, 					//认购
			Put						//认沽
	   };
	   
	   //Id of Exchanges
	   enum XExchangeType{
			UnknownEx, 				//未知交易所
			SSE,  					//上海证券交易所
			SZSE,  					//深圳证券交易所
			CFFE,  					//中国金融期货交易所
			SHFE,  					//上海期货交易所
			DCE,  					//大连商品交易所
			CZCE,  					//郑州商品交易所
			NYSE,  					//纽交所
			NASDAQ,  				//纳斯达克
			HKEx,  					//港交所
			TME,  					//天府商品交易所
			CME, 					//芝加哥商品交易所
			XSIM 					//模拟交易所，用于系统测试
		};
		sequence<XExchangeType> XExchangeList;
		
		["cpp:class", "cs:attribute:System.Serializable"]
		struct XExchangeInfo
		{
			XExchangeType			ExchangeId;
			string					FullName;
			Util::XTimeZone			TimeZone;
		};
		
		//Symbol's Id and Exchange, which be used to uniquely identify a symbol.
	   ["cpp:class", "cs:attribute:System.Serializable"]
	   struct XSymbolTag{
			string                	SymbolId;							//Unique Id in an exchange.
			XExchangeType         	ExchangeId = UnknownEx;				//The Id for the Exchange in which the Symbol is traded
	   };
	   sequence<XSymbolTag>  XSymbolTagSeries;
	   	   
	   //Basic Discription for a Symbol
	   ["cpp:class", "cs:attribute:System.Serializable"] 
	   struct XSymbol{
			string					SymbolName;                         	//Name of a Symbol
			XSymbolTag				SymbolTag;								//Tag of the Symbol
			XAssetClass				SymbolAssetClass = UnkownAsset;       	//The Type of a Symbol
			XSymbolTag				UnderlyingTag;                      	//The symbol tag of underlying
			double              	StrikePrice;                        	//Strike Price
			Util::XTime				ListingDate;                       		//Listing Date of Contract
			Util::XTime				ExpirationDate;                     	//Expiration Date of Contract
			string					CompanyName;							//the Company Name for this instance
			double					ContractSize;							//the contract size for the current symbol.For example, a Euro FX tick size is $0.0001. The contract size is 125,000 euros. The tick value is $12.50.
			int						DecimalPlaces;							//the number of significant decimal places for this symbol 
			string					Industry;								//the industry for this instance. 
			string					Sector;									//the Sector for this instance. 
			double              	LongMarginRate;                   		//the Margin Rate of Long Contract
			double    		        ShortMarginRate;                    	//the Margin Rate of Short Contract			
			double              	TickSize;                           	//the tick size for the current symbol. This is the smallest allowable increment of price movement for a contract.
			double              	FeeRate;                           		//Fee Rate of Contract
			int                 	MaxMarketOrderVolume;               	//Max Market Order Volume
			int                		MinMarketOrderVolume;               	//Min Market Order Volume
			int                 	MaxLimitOrderVolume;                	//Max Limit Order Volume
			int                 	MinLimitOrderVolume;                	//Min Limit Order Volume
			Util::XTime             DeliveryBeginDate;                  	//First Delivery Date
			Util::XTime             DeliveryEndDate;                    	//Last Delivery Date
			XContractType        	ContractType = NoContract;           	//NoContract, Call, Put
			Util::XCurrencyType     ExCurrency = Util::UndefinedCurrency;   //The Currency Type in which the Contract is traded
			Util::XCurrencyType     BaseCurrency = Util::UndefinedCurrency; //Base Currency Type of Contract
			string              	SymbolDescription;                 		//Description of Symbol
	   };
	   sequence<XSymbol> XSymbolSeries;
	   dictionary<XSymbolTag, XSymbol> XSymbolSet;
	};
};